package com.itheima.ydd.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.ydd.common.R;
import com.itheima.ydd.dto.PageInfo;
import com.itheima.ydd.dto.RoleDto;
import com.itheima.ydd.pojo.SysRole;
import org.springframework.http.ResponseEntity;

import java.util.List;

public interface SysRoleService extends IService<SysRole> {

    /**
     * 根据ID修改角色信息
     * @param roleDto
     * @return
     */
    ResponseEntity<R<String>> updateSysRole(RoleDto roleDto);

    /**
     * 角色添加
     * @param roleDto
     * @return
     */
    ResponseEntity<R<String>> addSysRole(RoleDto roleDto);

    /**
     * 根据ID删除角色
     * @param id
     * @return
     */
    ResponseEntity<R<String>> delSysRole(String id);

    /**
     * 分页
     * @param page
     * @param limit
     * @param name
     * @return
     */
    ResponseEntity<R<PageInfo<SysRole>>> findPageOrName(Integer page, Integer limit, String name);

    /**
     * 查询所有
     * @return
     */
    ResponseEntity<R<List<SysRole>>> findAllData();

    /**
     * 根据id查询
     * @param id
     * @return
     */
    ResponseEntity<R> findById(String id);
}
